################################################################
# Fulguro
# Copyright (C) 2004 Christophe Clienti
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
################################################################

include Makefile.include

MODULES_DIR	= src swig
TESTS_DIR       = tests

.PHONY: $(MODULES_DIR) $(TESTS_DIR) doc

all : objects

install: objects
	@for dir in $(MODULES_DIR); do \
		(cd $$dir; ${MAKE} install); \
	done

src_install:
	cd src; ${MAKE} install;

tests : 
	@for dir in $(TESTS_DIR); do \
		(cd $$dir; ${MAKE} tests 2>&1 | grep "\-\-"  ); \
	done

tests_verbose :
	@for dir in $(TESTS_DIR); do \
		(cd $$dir; ${MAKE} tests); \
	done

objects : $(MODULES_DIR)

$(MODULES_DIR):
	@cd $@; make all

doc:
	@cd swig; ${MAKE} doc
	@cd swig; ${MAKE} clean
	@cd doc; ${MAKE} all

clean :
	for dir in $(MODULES_DIR); do \
		(cd $$dir; ${MAKE} clean); \
	done
	for dir in $(TESTS_DIR); do \
		(cd $$dir; ${MAKE} clean); \
	done
	@rm -rf *~